package com.itheima.tcp2;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Anomaly
 * @date 2023/2/11 15:51
 */
public class Server {
    public static void main(String[] args) throws Exception {
        System.out.println("==============服务端启动=================");
        ServerSocket serverSocket = new ServerSocket(7777);
        while (true) {
            Socket socket = serverSocket.accept();
            System.out.println(socket.getRemoteSocketAddress()+"上线了。。");
            new ServerThread(socket).start();
        }
    }
}
